<?php

namespace App\Listeners;

use App\Models\PushUrl;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;

class PushPostUrl
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     *
     * @param  object $event
     * @return void
     */
    public function handle($event)
    {
        $data = [
            'url'    => 'http://' . $event->url . $event->path,
            'site'   => $event->url,
            'detail' => []
        ];
        $push = new PushUrl($data);
        $push->save();
    }
}
